﻿@using TestUp.Models.TestWorkers.TestsModel
@model TestUp.Models.UserModels.OpenTestModel

@using (Html.BeginForm("SubmitTest", "User"))
{
    @Html.HiddenFor(x => x.PendingTest.TestId)
    @Html.HiddenFor(x => x.PendingTest.PendingTestId)
    <div id="questionsArea">
        @for (int i = 0; i < Model.TestData.Questions.Count; i++)
        {
            
            switch (Model.TestData.Questions[i].TestType)
            {
                case TestTypes.CheckTest:
                @Html.Partial("TestTemplates/CheckTest", (CheckTest)Model.TestData.Questions[i])
                    break;
                case TestTypes.RadioTest:
                @Html.Partial("TestTemplates/RadioTest", (RadioTest)Model.TestData.Questions[i])
                    break;
                case TestTypes.InputTest:
                @Html.Partial("TestTemplates/InputTest", (InputTest)Model.TestData.Questions[i])
                    break;
                case TestTypes.EsseTest:
                    break;
                case TestTypes.MatchTest:
                    break;
                case TestTypes.FillTest:
                    break;
                default:
                    break;
            }
@*<fieldset id= "questionItem">
            <h3>@Model.TestData.Questions[i].QuestionText</h3>
                @for (int j = 0; j < Model.TestData.Questions[i].PossibleAnswers.Count; j++)
                {
                    <p>
                        @Html.CheckBoxFor(x => x.TestData.Questions[i].PossibleAnswers[j].Item2)
                        @Html.Label(Model.TestData.Questions[i].PossibleAnswers[j].Item1)
                    </p>
                }
            </fieldset>*@
        }
        <input type="submit" id="submitTest" value="Done!" />
    </div>
}
